﻿using System;
using System.Collections.Generic;
using MbUnit.Framework;
using Microsoft.SharePoint.WorkflowActions;
using TypeMock;

namespace DP.Sharepoint.Workflow.Tests
{
    using ForTesting;

    [TestFixture]
    public class LookupUserInfoTests : WorkflowSharePointFixture
    {
        [Test]
        public void AddingActivityToAWorkflowTest()
        {
            Dictionary<string, Object> wfArguments = new Dictionary<string, object>();
            Guid workflowId = Manager.CreateWorkflow(typeof(WorkflowSkeleton), wfArguments);

            LookupUserInfo activity = new LookupUserInfo();
            activity.__Context = new WorkflowContext();
            activity.UserName = "someuser";
            activity.UserProperty = "someproperty";

            WorkflowInstanceWrapper wrapper = Manager.FindWrapper(workflowId);
            AddActivityToWorkflowInstance(wrapper.WorkflowInstance, activity);


            Manager.RunWorkflow(workflowId, 5000);
        }
    }
}
